import gi

gi.require_version("Gtk", "3.0")
from gi.repository import Gtk


# class Handler:
#     def onDestroy(self, *args):
#         Gtk.main_quit()

#     def onButtonPressed(self, button):
#         print("Hello World!")
class App:
    def __init__(self,builder):
        self.builder=builder
        self.text1 = builder.get_object("text1")
        self.button1 = builder.get_object("button1")
        self.button1.connect("clicked", self.on_button_clicked)
    def on_button_clicked(self,button):
        # print("Hello World!=======")
        # print(type(self.text1),dir(self.text1))
        old=self.text1.get_text()
        print(dir(old))
        self.text1.set_text("hel");
builder = Gtk.Builder()
builder.add_from_file("builder_example.glade")
# builder.connect_signals(Handler())

app=App(builder)
window = builder.get_object("window1")
window.show_all()

Gtk.main()